import java.io.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Logger {
    public static void main(String[] args){
    }

    public static void log(String message){
        try {
            PrintStream ot = new PrintStream(new FileOutputStream("FileIo//log.txt", true));
            System.setOut(ot);
            LocalDateTime lt = LocalDateTime.now();
            DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
            String format = lt.format(dtf);
            System.out.println(format + "----" +message);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
